home *** CD-ROM | disk | FTP | other *** search
- head 1.25;
- branch ;
- access ;
- symbols ;
- locks ; strict;
- comment @@;
-
-
- 1.25
- date 91.04.11.12.53.23; author kupfer; state Exp;
- branches ;
- next 1.24;
-
- 1.24
- date 89.10.09.21.27.33; author rab; state Exp;
- branches ;
- next 1.23;
-
- 1.23
- date 89.08.24.21.49.03; author douglis; state Exp;
- branches ;
- next 1.22;
-
- 1.22
- date 89.08.18.11.21.22; author douglis; state Exp;
- branches ;
- next 1.21;
-
- 1.21
- date 89.08.17.11.14.40; author douglis; state Exp;
- branches ;
- next 1.20;
-
- 1.20
- date 89.04.06.21.40.09; author jhh; state Exp;
- branches ;
- next 1.19;
-
- 1.19
- date 88.12.31.14.44.56; author ouster; state Exp;
- branches ;
- next 1.18;
-
- 1.18
- date 88.11.27.16.28.11; author ouster; state Exp;
- branches ;
- next 1.17;
-
- 1.17
- date 88.08.20.12.58.20; author ouster; state Exp;
- branches ;
- next 1.16;
-
- 1.16
- date 88.08.12.14.38.23; author ouster; state Exp;
- branches ;
- next 1.15;
-
- 1.15
- date 88.07.21.11.34.57; author douglis; state Exp;
- branches ;
- next 1.14;
-
- 1.14
- date 88.07.20.10.22.09; author ouster; state Exp;
- branches ;
- next 1.13;
-
- 1.13
- date 88.07.02.14.33.53; author ouster; state Exp;
- branches ;
- next 1.12;
-
- 1.12
- date 88.06.29.14.31.29; author ouster; state Exp;
- branches ;
- next 1.11;
-
- 1.11
- date 88.06.29.14.30.07; author ouster; state Exp;
- branches ;
- next 1.10;
-
- 1.10
- date 88.06.27.09.56.35; author ouster; state Exp;
- branches ;
- next 1.9;
-
- 1.9
- date 88.06.17.16.27.37; author ouster; state Exp;
- branches ;
- next 1.8;
-
- 1.8
- date 88.06.17.13.59.48; author ouster; state Exp;
- branches ;
- next 1.7;
-
- 1.7
- date 88.06.17.09.00.42; author ouster; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 88.06.17.08.51.02; author ouster; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 88.06.16.09.37.27; author ouster; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 88.06.06.08.37.01; author ouster; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 88.06.05.11.38.59; author ouster; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 88.04.28.17.41.44; author ouster; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 88.04.28.09.45.25; author ouster; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.25
- log
- @Flush DEFTARGET: the default target is now determined by a pmake
- library file.
- @
- text
- @#!/sprite/cmds/csh -f
- #
- # A script to generate (or regenerate) a library directory Makefile
- # from a prototype Makefile. If ./Makefile.proto exists, use it, else
- # use a common prototype. This script is invoked for libraries that
- # have their sources distributed among a number of subdirectories; this
- # script is invoked in the subdirectories.
- #
- # We assume we were invoked from mkmf. Parameters passed in from mkmf
- # through environment variables:
- #
- # DOMACHINES names of machines we are supposed to run mkmf on
- # MKMFDIR directory containing prototype makefiles
- # MKMFFLAGS arguments to all mkmfs run recursively
- # MACHINES list of machine names (e.g. "sun2 sun3"), for
- # which there are machine-dependent subdirectories
- # (sun3.md, spur.md, etc.) of this directory.
- # MAKEFILE name of makefile to create
- # SUBTYPE information about what type of library this is:
- # used to figure out where to install things.
- #
-
- #
- # Argument processing. (Generalized form, even though just one flag so far.)
- #
- while ($#argv >= 1)
- if ("$1" == '-x') then
- set echo
- endif
- shift
- end
-
- set subtype=$SUBTYPE
- set lib=$cwd:h
- set lib=$lib:t
- set subdir=$cwd:t
- set pref='[a-z_A-Z]'
- set machines=($MACHINES)
- set domachines = ($DOMACHINES)
- set makefile=$MAKEFILE
- set distdir=($DISTDIR)
-
- if (-e $makefile.proto) then
- set proto=$makefile.proto
- else
- set proto="${MKMFDIR}/Makefile.biglib"
- endif
-
- echo "Generating $makefile for library subdirectory $lib/$cwd:t using $proto"
-
- set nonomatch
- set hdrs =( ${subdir}*.h )
- if ("$hdrs" == "${subdir}*.h") set hdrs=()
- set pubHdrs=(`echo $hdrs | sed -e "s/[^ ]*Int.h//g"`)
- set allSrcs =( ${pref}*.[cylsp] )
- #
- # Check to see if there were any sources. The first check (size == 1)
- # is only necessary because the second check will cause an error if
- # allSrcs contains more than 1024 bytes.
- #
- if ($#allSrcs == 1) then
- if ("$allSrcs" == "${pref}*.[cylsp]") set allSrcs=()
- endif
- set mdSrcs =( *.md/${pref}*.[cylsp] )
- if ($#mdSrcs == 1) then
- if ("$mdSrcs" == "*.md/${pref}*.[cylsp]") set mdSrcs=()
- endif
- set allSrcs=($allSrcs $mdSrcs)
- set lints = ( *.lint )
- if ("$lints" == "*.lint") set lints=()
- set manPages = (*.man)
- if ("$manPages" == "*.man") set manPages=()
-
- #
- # Use sed to substitute various interesting things into the prototype
- # makefile. The code below is a bit tricky because some of the variables
- # being substituted in can be very long: if the substitution is passed
- # to sed with "-e", the entire variable must fit in a single shell argument,
- # with a limit of 1024 characters. By generating a separate script file
- # for the very long variables, the variables get passed through (to the
- # script file) as many arguments, which gets around the length problem.
- #
-
- rm -f mkmf.tmp.sed
- echo s,"@@(ALLSRCS)",$allSrcs,g > mkmf.tmp.sed
- echo s,"@@(MANPAGES)",$manPages,g > mkmf.tmp.sed2
- cat $proto | sed -f mkmf.tmp.sed -f mkmf.tmp.sed2 \
- -e "s,@@(DATE),`date`,g" \
- -e "s,@@(LINTSRCS),$lints,g" \
- -e "s,@@(MACHINES),$machines,g" \
- -e "s,@@(MAKEFILE),$makefile,g" \
- -e "s,@@(MANPAGES),$manPages,g" \
- -e "s,@@(NAME),$lib,g" \
- -e "s,@@(PUBHDRS),$pubHdrs,g" \
- -e "s,@@(SUBDIR),$subdir,g" \
- -e "s,@@(TEMPLATE),$proto,g" \
- -e "s,@@(TYPE),$subtype,g" \
- -e "s,@@(DISTDIR),$distdir,g" \
- > $makefile
- rm -f mkmf.tmp.sed mkmf.tmp.sed2
-
- setenv PARENTDIR $cwd
- foreach i ($domachines)
- (cd $i.md; mkmf $MKMFFLAGS -f md.mk)
- end
- @
-
-
- 1.24
- log
- @Modifications for distribution.
- @
- text
- @a11 1
- # DEFTARGET name of default target
- a40 1
- set defTarget=($DEFTARGET)
- a88 1
- -e "s,@@(DEFTARGET),${defTarget:q},g" \
- @
-
-
- 1.23
- log
- @fixed typo
- @
- text
- @d43 1
- d101 1
- @
-
-
- 1.22
- log
- @another change for TM -- use single machine if it exists, else \ds3100
- @
- text
- @d90 1
- a90 1
- -e "s,@@(DEFTARGET),$ {defTarget:q},g" \
- @
-
-
- 1.21
- log
- @removed DEFTARGET -- we use $MACHINE now
- @
- text
- @d12 1
- d42 1
- d90 1
- @
-
-
- 1.20
- log
- @added abilty to make specific machine types
- @
- text
- @a11 1
- # DEFTARGET name of default target
- a40 1
- set defTarget=($DEFTARGET)
- a87 1
- -e "s,@@(DEFTARGET),$defTarget,g" \
- @
-
-
- 1.19
- log
- @Use TYPE instead of INSTALLDIR, INSTALLMAN, etc.
- @
- text
- @d12 2
- d40 1
- d42 1
- a51 6
- if (" $machines " =~ *\ sun3\ *) then
- set defTarget=sun3
- else
- set defTarget=$machines[1]
- endif
-
- d103 2
- a104 1
- foreach i ($machines)
- @
-
-
- 1.18
- log
- @Various changes to replace old C library entirely with new C library.
- @
- text
- @a35 13
- switch ($subtype)
- case sprite:
- set includedir=/sprite/lib/include
- set installman=/sprite/doc/ref/lib/$lib
- breaksw
- case x:
- set includedir=/X/lib/include
- set installman=/X/doc/ref/lib/$lib
- breaksw
- default:
- echo Unknown library subtype "$subtype"
- exit 1
- endsw
- a92 2
- -e "s,@@(INCLUDEDIR),$includedir,g" \
- -e "s,@@(INSTALLMAN),$installman,g" \
- d101 1
- @
-
-
- 1.17
- log
- @Add x subtype.
- @
- text
- @a20 19
- # Variables generated here:
- # includedir place where public header files get installed
- # lib base library name to create (directories are assumed
- # to be named after the libraries they create):
- # c, tcl, sx, etc. This is actually the name of the
- # parent directory.
- # lints list of ".lint" files; these are dummy .c files
- # that supply lint information for assembler procedures
- # that lint cannot process.
- # machines list of machines for which we can target: needed
- # because env variables can't always be used where
- # variables can.
- # makefile name of the makefile to create
- # pref prefix pattern that files must match to be included
- # proto name of prototype makefile to use to create $makefile
- # pubHdrs list of header files that this directory exports to
- # the rest of the world.
- # subdir name of this directory (the sub-piece of the library)
- #
- d33 3
- d38 2
- a39 1
- set includedir=/sprite/lib/include.new
- d42 2
- a43 1
- set includedir=/a/X/lib/include
- a48 3
- set lib=$cwd:h
- set lib=$lib:t
- set subdir=$cwd:t
- d87 2
- d102 3
- a104 4
- cat $proto | sed -f mkmf.tmp.sed \
- -e "s,@@(LIBRARY),$lib,g" \
- -e "s,@@(SUBDIR),$subdir,g" \
- -e "s,@@(MACHINES),$machines,g" \
- d107 1
- a107 1
- -e "s,@@(PUBHDRS),$pubHdrs,g" \
- d109 1
- d111 4
- a115 1
- -e "s,@@(DATE),`date`,g" \
- d117 1
- a117 1
- rm -f mkmf.tmp.sed
- @
-
-
- 1.16
- log
- @No need to look for MAKEFILE or MACHINES. Also, be more restrictive
- on which headers are exported.
- @
- text
- @d56 3
- @
-
-
- 1.15
- log
- @added ability to turn on echoing for all mkmf's invoked.
- @
- text
- @d18 1
- a18 1
- # TYPE information about what type of library this is:
- a38 1
- # type type of makefile to make (e.g. att, src, local, etc.)
- d51 2
- a52 4
-
-
- set type=$TYPE
- switch ($type)
- d57 1
- a57 1
- echo Unknown library type "$type"
- a63 5
-
- if ($?MACHINES == 0) then
- echo "No target machines for $lib/$cwd:t"
- exit 1
- endif
- d65 1
- a65 4
- if ("$machines" == "") then
- echo "No target machines for $lib/$cwd:t"
- exit 1
- endif
- a66 6
- if ($?MAKEFILE) then
- set makefile=$MAKEFILE
- else
- set makefile=Makefile
- endif
-
- d82 2
- a83 2
- set hdrs =( ${pref}*.h )
- if ("$hdrs" == "${pref}*.h") set hdrs=()
- a130 2
-
- pmake dependall
- @
-
-
- 1.14
- log
- @Add code to be more careful about long lists of source files.
- @
- text
- @d13 1
- d42 12
- d146 1
- a146 1
- (cd $i.md; mkmf -f md.mk)
- @
-
-
- 1.13
- log
- @Better support for lint, and for dummy lint files (*.lint).
- @
- text
- @d90 13
- a102 4
- if ("$allSrcs" == "${pref}*.[cylsp]") set allSrcs=()
- set mdsrcs =( *.md/${pref}*.[cylsp] )
- if ("$mdsrcs" == "*.md/${pref}*.[cylsp]") set mdsrcs=()
- set allSrcs=($allSrcs $mdsrcs)
- @
-
-
- 1.12
- log
- @Didn't quite get last change right.
- @
- text
- @d21 1
- a21 1
- # type type of makefile to make (e.g. att, src, local, etc.)
- d24 5
- a28 4
- # c, tcl, sx, etc.
- # pref prefix pattern that files must match to be included
- # makefile name of the makefile to create
- # proto name of prototype makefile to use to create $makefile
- d32 7
- d52 1
- d94 2
- d111 1
- d116 1
- @
-
-
- 1.11
- log
- @Had bad error message for missing .md directories.
- @
- text
- @d47 1
- a47 1
- echo "No target machines for $lib"
- d52 1
- a52 1
- echo "No target machines for $lib"
- @
-
-
- 1.10
- log
- @Add "type" field to map, pass it through to individual mkmf.*
- scripts so they don't have to do their own path-name analysis.
- @
- text
- @d47 1
- a47 1
- echo "No target machines for $prog"
- d52 1
- a52 1
- echo "No target machines for $prog"
- @
-
-
- 1.9
- log
- @Changes to handle directories with many many files.
- @
- text
- @d17 2
- d32 2
- a33 1
- set type=`expr $cwd : '/[^/]*/\([^/]*\)/.*'`
- d35 1
- a35 1
- case src:
- a37 6
- case att:
- set includedir=/att/lib/include
- breaksw
- case local:
- set includedir=/local/lib/include
- breaksw
- d39 1
- a39 1
- echo Don\'t know how to mkmf this library
- @
-
-
- 1.8
- log
- @For now, install headers in include.new.
- @
- text
- @d89 13
- a101 1
- cat $proto | sed \
- a104 1
- -e "s,@@(ALLSRCS), $allSrcs,g" \
- d111 1
- @
-
-
- 1.7
- log
- @Change default Makefile from Makefile.libc.srcDir to Makefile.biglib.
- @
- text
- @d33 1
- a33 1
- set includedir=/sprite/lib/include/new
- @
-
-
- 1.6
- log
- @Generate "ALLSRCS".
- @
- text
- @d68 1
- a68 1
- set proto="${MKMFDIR}/Makefile.libc.srcDir"
- @
-
-
- 1.5
- log
- @Minor editorial cleanup; no functional changes.
- @
- text
- @d83 5
- d93 1
- @
-
-
- 1.4
- log
- @Print out actual name of makefile when it's different from "Makefile".
- @
- text
- @d4 1
- a4 1
- # from the prototype Makefile. If ./Makefile.proto exists, use it, else
- d14 1
- a14 1
- # which there are machine-specific subdirectories
- d26 3
- a28 2
- # machines list of machines for which we can target: corresponds
- # to .md directories in the PARENT of this directory.
- d36 1
- a36 1
- set includedir=/sprite/att/lib/include
- d39 1
- a39 1
- set includedir=/sprite/local/lib/include
- d95 1
- a95 1
- foreach i ($MACHINES)
- @
-
-
- 1.3
- log
- @Various revisions to generate Makefiles for multi-directory
- libraries with multiple target machines.
- @
- text
- @d70 1
- a70 1
- echo "Generating a Makefile for library subdirectory $lib/$cwd:t using $proto"
- @
-
-
- 1.2
- log
- @New mkmf stuff for new library area.
- @
- text
- @d9 2
- a10 3
- # We assume we were invoked from mkmf, thus we don't need to alter the
- # path, and MKMFDIR is in the environment to tell us where to find prototype
- # makefiles, etc.
- d12 7
- a18 1
- # Variables:
- d25 3
- a27 4
- # MKMFDIR directory containing prototype makefiles
- # MACHINES list of machines for which machine-specific
- # directories exist in the parent directory (passed
- # from mkmf as an environment variable)
- a31 1
- set lintdir=/sprite/lib/lint
- a34 1
- set lintdir=/sprite/att/lib/lint
- a37 1
- set lintdir=/sprite/local/lib/lint
- d48 10
- d72 4
- a75 28
- #
- # First figure out what's there by way of .c, .y, .l, .s, .p, .h and .o files
- # If any one doesn't have any members, it'll contain the original
- # pattern (b/c of nonomatch). We want it to be empty, though, so
- # we reset it.
- #
- set nonomatch
- set srcs=( ${pref}*.[cylsp] )
- if ("$srcs" == "${pref}*.[cylsp]") set srcs=()
- set Hfiles=( ${pref}*.h )
- if ("$Hfiles" == "${pref}*.h") set Hfiles=()
- rm -f version.o
- set Ofiles=( ${pref}*.o )
- if ("$Ofiles" == "${pref}*.o") set Ofiles=()
- unset nonomatch
-
- #
- # Merge in any .o files that can be created from local source files but don't
- # exist yet. In addition, figure out which .o files may be safely removed
- # during a "make clean" and store them in RmOfiles.
- #
- set RmOfiles=""
- if ("$srcs" != "") then
- foreach file ($srcs)
- set file=$file:r.o
- set RmOfiles=($RmOfiles $file)
- if (! -e $file) set Ofiles=($Ofiles $file)
- end
- d78 4
- a81 1
- set PubHfiles=(`echo $Hfiles | sed -e "s/${pref}*Int\.h//g"`)
- a82 2
- if (-e $makefile) mv $makefile $makefile.$$~
-
- d85 2
- a86 6
- -e "s,@@(OBJS),$Ofiles,g" \
- -e "s,@@(CLEANOBJS),$RmOfiles,g" \
- -e "s,@@(SRCS),$srcs,g" \
- -e "s,@@(HDRS),$Hfiles,g" \
- -e "s,@@(PUBHDRS),$PubHfiles,g" \
- -e "s,@@(LINTDIR),$lintdir,g" \
- d88 2
- a91 1
- -e "s,@@(MAKEFILE),$makefile,g" \
- d93 6
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @@
-